const fp = require('lodash/fp');
let cars = [];

// 2.1
let f1 = fp.flowRight(fp.prop('in_stock'), fp.last);
f1(cars);

// 2.2
let f2 = fp.flowRight(fp.prop('name'), fp.first);
f2(cars);

// 2.3
let f3 = fp.flowRight(_average, fp.map((car) => car.dollar_value));
f3(cars);

// 2.4
let sanitizeName = fp.flowRight(fp.map(fp.flowRight(fp.toUpper, _underscore)), fp.map((car) => car.name));
sanitizeName(cars);
